feat: More work on Anthropic and OpenAI responses#5
Merged
tymondesigns merged 10 commits intomainfrom Aug 14, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several enhancements and refactors to the LLM (Large Language Model) abstraction and its Anthropic driver, focusing on improved output parsing control, expanded tool calling configuration, and richer message/content handling. The changes add new configuration options, improve type safety, and enhance the flexibility of message and tool representations.
Core LLM API and Configuration Improvements:
shouldParseOutputmethod inAbstractLLM, its contract, and the cache decorator. This allows output parsing to be disabled in pipeline contexts where parsing is handled separately. [1] [2] [3] [4]StructuredOutputModeand related configuration inAbstractLLM, allowing more granular control over structured output behaviors. [1] [2]Tool Calling Enhancements:
withTools,addTool, andToolConfig) to support theallowParallelToolCallsoption, enabling parallel tool calls if desired. [1] [2] [3]Toolcontract by requiring theschema()method to return anObjectSchemainstead of a genericSchema. [1] [2]Message and Content Handling:
AssistantMessagenow supports an optionalid,ReasoningContentincludes anid, andTextContentcan be nullable and handles variable replacement more robustly. [1] [2] [3]AnthropicChat) now processes multiple content types, including reasoning, and builds richer message collections from response content. [1] [2]Usage and Metrics:
reasoningTokensmetric to theUsagedata structure for more detailed token accounting.Workflow Improvements:
type-coveragejob to the static analysis workflow, enforcing 100% type coverage using Pest.